<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <form id="formfield">
        <input type="text" name="name[]" />
        <input type="text" name="name[]" />
        <input type="text" name="name[]" />
        <input type="text" name="id" />
        <input type="text" name="id" />
        <button id="submit" onclick="sendData()">submit</button>
    </form>

    <script>
        function sendData() {
            let dataField = document.getElementById('formfield');
            let data = new FormData(dataField);
            let xhr = new XMLHttpRequest();
            xhr.open('POST', 'http://127.0.0.1:1234');
            console.log(typeof data.get('name[]'));
            xhr.send();
        }
    </script>
</body>
</html>